*****************************************************
***** PROJECT: Beyond the Dichotomous Vote: Can Expressive Ballots Increase Ideological Congruence and Decrease Parliamentary Polarization?
***** AUTHORS: Victor Ellenbroek, Maurits J. Meijers and André Krouwel
***** PUBLISHED IN: Government & Opposition
***** CONTENT: Analyses in main text
*****************************************************

use EllenbroekMeijersKrouwel2019.dta, clear

***** FIG. 1 *****
hist rmax, freq xtitle("Seat Proportion Largest Party (AB)")

***** FIG. 2 *****
regress DistLRnew3 i.StemType if CV13 == 1 | Gestemd13== 1
margins StemType, atmeans
marginsplot, title("") ytitle("Marginal Effect on Ideological Congruence") xtitle("") title("Economic Dimension") ysc(r(-1.9 -1.3)) yla(-1.9(0.1)-1.3) saving(LR_OLSMFX, replace)

regress DistCPnew3 i.StemType if CV13 == 1 | Gestemd13== 1
margins StemType, atmeans
marginsplot, title("") ytitle("") xtitle("") title("Cultural Dimension") saving(CP_OLSMFX, replace) ysc(r(-1.9 -1.3)) yla(-1.9(0.1)-1.3)

graph combine LR_OLSMFX.gph CP_OLSMFX.gph

***** FIG. 3 *****
eststo clear
eststo m1a: regress DistLRnew3 i.StemType##c.LRdist_closest_party##c.LRdist_closest_party  if CV13 == 1 | Gestemd13== 1
margins StemType, at (LRdist_closest_party =(0(0.1)1))
marginsplot, title("") ytitle("") ysc(r(-2.5 -1)) yla(-2.5(0.5)-.5) xtitle("Distance to Closest Party") ytitle("Marginal Effect of Ballot Type") title("Economic Dimension") saving(MFX_dist_LR_quadratic, replace)

eststo m1b: regress DistCPnew3 i.StemType##c.CPdist_closest_party##c.CPdist_closest_party if CV13 == 1 | Gestemd13== 1
margins StemType, at (CPdist_closest_party =(0(0.1)1))
marginsplot, title("") ytitle("") ysc(r(-2.5 -1)) yla(-2.5(0.5)-.5) xtitle("Distance to Closest Party") ytitle("") title("Cultural Dimension") saving(MFX_dist_CP_quadratic, replace)

grc1leg MFX_dist_LR_quadratic.gph MFX_dist_CP_quadratic.gph 

***** FIG. 4 *****
eststo m2a: regress DistLRnew3 i.StemType##c.Q72##c.Q72 if CV13 == 1 | Gestemd13== 1
margins StemType, at (Q72 =(1(1)11))
marginsplot, title("Economic Dimension") ytitle("Marginal Effect on Ideological Congruence") ysc(r(-4 0)) yla(-4(0.5)0) saving(LR_interaction_R&R_quadratic, replace) 

eststo m2b: regress DistCPnew3 i.StemType##c.Q76rev##c.Q76rev  if CV13 == 1 | Gestemd13== 1
margins StemType, at (Q76rev =(1(1)11))
marginsplot, title("Cultural Dimension") ytitle("") ysc(r(-4 0)) yla(-4(0.5)0) saving(CP_interaction_R&R_quadratic, replace) 

grc1leg LR_interaction_R&R_quadratic.gph CP_interaction_R&R_quadratic.gph
